﻿using System.Reflection;

namespace BorgExt
{
    internal class EventHandlerInfo
    {
        public string Name { get; internal set; }

        public MethodInfo MethodInfo { get; internal set; }

        public EventHandlerInfo(string name)
        {
            Name = name;
        }

        public EventHandlerInfo(string name, MethodInfo methodInfo)
            : this(name)
        {
            MethodInfo = methodInfo;
        }

        internal object Invoke(object target, params object[] parameters)
        {
            return MethodInfo.Invoke(target, parameters);
        }
    }
}

